package com.expoente;

public class DroidBusConstants {
	public static final String DATABASE_NAME = "droidbus.db";
	public static final int DATABASE_VERSION = 1;
	public static final String LINES_PROPERTIES = "lines.properties";
	public static final String PLACES_PROPERTIES = "places.properties";
	public static final String ROUTES_PROPERTIES = "routes.properties";

	public static final String TABLE_LINE = "line";
	public static final String TABLE_PLACE = "place";
	public static final String TABLE_ROUTE = "route";

	public static final String KEY_ID = "_id";
	public static final String KEY_NAME = "name";
	public static final String KEY_COST = "cost";
	public static final String KEY_ADDRESS = "address";
	public static final String KEY_ID_LINE = "id_line";
	public static final String KEY_ID_PLACE = "id_place";
	public static final String KEY_ORDER = "_order";
	public static final String KEY_LATITUDE = "latitude";
	public static final String KEY_LONGITUDE = "longitude";

	public static final String[] LINE_COLUMNS = { KEY_ID, KEY_NAME, KEY_COST };
	public static final String[] PLACE_COLUMNS = { KEY_ID, KEY_ADDRESS,
			KEY_LATITUDE, KEY_LONGITUDE };
	public static final String[] ROUTE_COLUMNS = { KEY_ID_LINE, KEY_ID_PLACE,
			KEY_ORDER };

	public static final String DROP_TABLE_LINE = "DROP TABLE IF EXISTS LINE;";
	public static final String DROP_TABLE_PLACE = "DROP TABLE IF EXISTS PLACE;";
	public static final String DROP_TABLE_ROUTE = "DROP TABLE IF EXISTS ROUTE;";

	public static final String CREATE_LINE = "CREATE TABLE IF NOT EXISTS "
			+ DroidBusConstants.TABLE_LINE + "" + " ("
			+ DroidBusConstants.KEY_ID + " INTEGER PRIMARY KEY autoincrement,	"
			+ DroidBusConstants.KEY_NAME + " TEXT,	"
			+ DroidBusConstants.KEY_COST + " REAL);";

	public static final String CREATE_PLACE = "CREATE TABLE IF NOT EXISTS "
			+ DroidBusConstants.TABLE_PLACE + "" + " ("
			+ DroidBusConstants.KEY_ID + " INTEGER PRIMARY KEY autoincrement,	"
			+ DroidBusConstants.KEY_ADDRESS + " TEXT, "
			+ DroidBusConstants.KEY_LATITUDE + " FLOAT, "
			+ DroidBusConstants.KEY_LONGITUDE + " FLOAT);";

	public static final String CREATE_ROUTE = "CREATE TABLE IF NOT EXISTS "
			+ DroidBusConstants.TABLE_ROUTE + "" + " ("
			+ DroidBusConstants.KEY_ID_LINE + " INTEGER,	"
			+ DroidBusConstants.KEY_ID_PLACE + " INTEGER,	"
			+ DroidBusConstants.KEY_ORDER + " INTEGER," + " FOREIGN KEY("
			+ DroidBusConstants.KEY_ID_LINE + ") REFERENCES LINE("
			+ DroidBusConstants.KEY_ID + ")," + " FOREIGN KEY("
			+ DroidBusConstants.KEY_ID_PLACE + ") REFERENCES PLACE("
			+ DroidBusConstants.KEY_ID + "));";

	public static final String PROPERTIES_ERROR = "Properties Error";
	public static final String RESET_DATABASE = "Reset Database Error";
}
